home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 January - Disc 2
/
Macworld (1999-01) (Disk 2).dmg
/
Serious Demos
/
Symbolic Composer 4.2
/
Environment
/
System
/
DEF
/
Utilities
/
Lengths
/
length-quantize
< prev
next >
Wrap
Lisp/Scheme
|
1998-10-23
|
554b
|
16 lines
length-quantize quant min max vector/list
This quantizer is for quantizing metric values. Values can be both ticks and length symbols. Output is always ratios and is applicable to lengths, durations, zones, tempo-zones and grooves.
(setq lenpat '(1/2 1/16 1/16 1/16.))
(length-quantize 1/32 1/16 1/4 lenpat)
--> #(7/32 7/32 1/16 1/16)
(length-quantize 1/32 1/16 1/4 (gen-sin 1 1 64))
--> #(1/8 1/8 5/32 5/32 5/32 5/32 ...
Positive and negative ranges can be used:
(length-quantize 1/32. -1/16 1/4 (gen-sin 1 1 64))
--> #(5/64 5/64 5/64 5/64 1/8 ...